3.261 \(\int \cot (x) \sqrt{a+a \tan ^2(x)} \, dx\)

Optimal. Leaf size=24 \[ -\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a \sec ^2(x)}}{\sqrt{a}}\right ) \]

[Out]

-(Sqrt[a]*ArcTanh[Sqrt[a*Sec[x]^2]/Sqrt[a]])

________________________________________________________________________________________

Rubi [A]  time = 0.0729868, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {3657, 4124, 63, 207} \[ -\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a \sec ^2(x)}}{\sqrt{a}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cot[x]*Sqrt[a + a*Tan[x]^2],x]

[Out]

-(Sqrt[a]*ArcTanh[Sqrt[a*Sec[x]^2]/Sqrt[a]])

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4124

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Dist[b/(2*f), Subst[In
t[(-1 + x)^((m - 1)/2)*(b*x)^(p - 1), x], x, Sec[e + f*x]^2], x] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p] &&
 IntegerQ[(m - 1)/2]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cot (x) \sqrt{a+a \tan ^2(x)} \, dx &=\int \cot (x) \sqrt{a \sec ^2(x)} \, dx\\ &=\frac{1}{2} a \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a x}} \, dx,x,\sec ^2(x)\right )\\ &=\operatorname{Subst}\left (\int \frac{1}{-1+\frac{x^2}{a}} \, dx,x,\sqrt{a \sec ^2(x)}\right )\\ &=-\sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a \sec ^2(x)}}{\sqrt{a}}\right )\\ \end{align*}

Mathematica [A]  time = 0.0177689, size = 30, normalized size = 1.25 \[ \cos (x) \sqrt{a \sec ^2(x)} \left (\log \left (\sin \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]*Sqrt[a + a*Tan[x]^2],x]

[Out]

Cos[x]*(-Log[Cos[x/2]] + Log[Sin[x/2]])*Sqrt[a*Sec[x]^2]

________________________________________________________________________________________

Maple [A]  time = 0.096, size = 23, normalized size = 1. \begin{align*} \cos \left ( x \right ) \sqrt{{\frac{a}{ \left ( \cos \left ( x \right ) \right ) ^{2}}}}\ln \left ( -{\frac{\cos \left ( x \right ) -1}{\sin \left ( x \right ) }} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)*(a+a*tan(x)^2)^(1/2),x)

[Out]

cos(x)*(a/cos(x)^2)^(1/2)*ln(-(cos(x)-1)/sin(x))

________________________________________________________________________________________

Maxima [B]  time = 1.86701, size = 51, normalized size = 2.12 \begin{align*} -\frac{1}{2} \, \sqrt{a}{\left (\log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) - \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right )\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)*(a+a*tan(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/2*sqrt(a)*(log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) - log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1))

________________________________________________________________________________________

Fricas [A]  time = 1.39649, size = 180, normalized size = 7.5 \begin{align*} \left [\frac{1}{2} \, \sqrt{a} \log \left (\frac{a \tan \left (x\right )^{2} - 2 \, \sqrt{a \tan \left (x\right )^{2} + a} \sqrt{a} + 2 \, a}{\tan \left (x\right )^{2}}\right ), \sqrt{-a} \arctan \left (\frac{\sqrt{a \tan \left (x\right )^{2} + a} \sqrt{-a}}{a}\right )\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)*(a+a*tan(x)^2)^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(a)*log((a*tan(x)^2 - 2*sqrt(a*tan(x)^2 + a)*sqrt(a) + 2*a)/tan(x)^2), sqrt(-a)*arctan(sqrt(a*tan(x)^
2 + a)*sqrt(-a)/a)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a \left (\tan ^{2}{\left (x \right )} + 1\right )} \cot{\left (x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)*(a+a*tan(x)**2)**(1/2),x)

[Out]

Integral(sqrt(a*(tan(x)**2 + 1))*cot(x), x)

________________________________________________________________________________________

Giac [A]  time = 1.09717, size = 32, normalized size = 1.33 \begin{align*} \frac{a \arctan \left (\frac{\sqrt{a \tan \left (x\right )^{2} + a}}{\sqrt{-a}}\right )}{\sqrt{-a}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)*(a+a*tan(x)^2)^(1/2),x, algorithm="giac")

[Out]

a*arctan(sqrt(a*tan(x)^2 + a)/sqrt(-a))/sqrt(-a)